package org.jsola.contract.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.contract.constant.AccountType;
import org.jsola.contract.constant.EnterpriseRegType;
import org.jsola.contract.constant.EnterpriseUserType;
import org.jsola.contract.constant.LegalAreaType;
import org.jsola.contract.constant.OrganType;
import org.jsola.contract.constant.PersonAreaType;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;

import javax.validation.constraints.NotNull;

import static org.jsola.contract.example.AccountExample.E_ADDRESS;
import static org.jsola.contract.example.AccountExample.E_AGENT_ID_NO;
import static org.jsola.contract.example.AccountExample.E_AGENT_NAME;
import static org.jsola.contract.example.AccountExample.E_COUNTRY;
import static org.jsola.contract.example.AccountExample.E_DEPARTMENT;
import static org.jsola.contract.example.AccountExample.E_EMAIL;
import static org.jsola.contract.example.AccountExample.E_ID_NO;
import static org.jsola.contract.example.AccountExample.E_LEGAL_AREA;
import static org.jsola.contract.example.AccountExample.E_LEGAL_NAME;
import static org.jsola.contract.example.AccountExample.E_MEMBER_ID;
import static org.jsola.contract.example.AccountExample.E_MOBILE;
import static org.jsola.contract.example.AccountExample.E_NAME;
import static org.jsola.contract.example.AccountExample.E_ORGAN;
import static org.jsola.contract.example.AccountExample.E_ORGAN_CODE;
import static org.jsola.contract.example.AccountExample.E_ORGAN_TYPE;
import static org.jsola.contract.example.AccountExample.E_PERSON_AREA;
import static org.jsola.contract.example.AccountExample.E_PROVINCE;
import static org.jsola.contract.example.AccountExample.E_REG_TYPE;
import static org.jsola.contract.example.AccountExample.E_SCOPE;
import static org.jsola.contract.example.AccountExample.E_SOURCE;
import static org.jsola.contract.example.AccountExample.E_TITLE;
import static org.jsola.contract.example.AccountExample.E_TYPE;
import static org.jsola.contract.example.AccountExample.E_USER_TYPE;
import static org.jsola.contract.example.AccountExample.M_ADDRESS_MAX;
import static org.jsola.contract.example.AccountExample.M_AGENT_ID_NO_MAX;
import static org.jsola.contract.example.AccountExample.M_AGENT_NAME_MAX;
import static org.jsola.contract.example.AccountExample.M_COUNTRY_MAX;
import static org.jsola.contract.example.AccountExample.M_DEPARTMENT_MAX;
import static org.jsola.contract.example.AccountExample.M_EMAIL_MAX;
import static org.jsola.contract.example.AccountExample.M_ID_NO_MAX;
import static org.jsola.contract.example.AccountExample.M_LEGAL_AREA_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.M_LEGAL_NAME_MAX;
import static org.jsola.contract.example.AccountExample.M_MEMBER_ID_MAX;
import static org.jsola.contract.example.AccountExample.M_MEMBER_ID_NOT_NULL;
import static org.jsola.contract.example.AccountExample.M_MOBILE_MAX;
import static org.jsola.contract.example.AccountExample.M_NAME_MAX;
import static org.jsola.contract.example.AccountExample.M_ORGAN_CODE_MAX;
import static org.jsola.contract.example.AccountExample.M_ORGAN_MAX;
import static org.jsola.contract.example.AccountExample.M_ORGAN_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.M_PERSON_AREA_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.M_PERSON_AREA_MAX;
import static org.jsola.contract.example.AccountExample.M_PROVINCE_MAX;
import static org.jsola.contract.example.AccountExample.M_REG_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.M_REG_TYPE_MAX;
import static org.jsola.contract.example.AccountExample.M_SCOPE_MAX;
import static org.jsola.contract.example.AccountExample.M_SOURCE_MAX;
import static org.jsola.contract.example.AccountExample.M_TITLE_MAX;
import static org.jsola.contract.example.AccountExample.M_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.M_TYPE_NOT_NULL;
import static org.jsola.contract.example.AccountExample.M_USER_TYPE_ENUM_NOT_MATCH;
import static org.jsola.contract.example.AccountExample.N_ADDRESS;
import static org.jsola.contract.example.AccountExample.N_AGENT_ID_NO;
import static org.jsola.contract.example.AccountExample.N_AGENT_NAME;
import static org.jsola.contract.example.AccountExample.N_COUNTRY;
import static org.jsola.contract.example.AccountExample.N_DEPARTMENT;
import static org.jsola.contract.example.AccountExample.N_EMAIL;
import static org.jsola.contract.example.AccountExample.N_ID_NO;
import static org.jsola.contract.example.AccountExample.N_LEGAL_AREA;
import static org.jsola.contract.example.AccountExample.N_LEGAL_NAME;
import static org.jsola.contract.example.AccountExample.N_MEMBER_ID;
import static org.jsola.contract.example.AccountExample.N_MOBILE;
import static org.jsola.contract.example.AccountExample.N_NAME;
import static org.jsola.contract.example.AccountExample.N_ORGAN;
import static org.jsola.contract.example.AccountExample.N_ORGAN_CODE;
import static org.jsola.contract.example.AccountExample.N_ORGAN_TYPE;
import static org.jsola.contract.example.AccountExample.N_PERSON_AREA;
import static org.jsola.contract.example.AccountExample.N_PROVINCE;
import static org.jsola.contract.example.AccountExample.N_REG_TYPE;
import static org.jsola.contract.example.AccountExample.N_SCOPE;
import static org.jsola.contract.example.AccountExample.N_SOURCE;
import static org.jsola.contract.example.AccountExample.N_TITLE;
import static org.jsola.contract.example.AccountExample.N_TYPE;
import static org.jsola.contract.example.AccountExample.N_USER_TYPE;

/**
 * 账户信息
 *
 * @author JanusMix
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "新增【账户信息】的参数")
@Data
public class AccountAddDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, required = true, allowableValues = AccountType.VALUES_STR)
    @NotNull(message = M_TYPE_NOT_NULL)
    @Const(constClass = AccountType.class, message = M_TYPE_ENUM_NOT_MATCH)
    private Integer type;

    @ApiModelProperty(notes = N_MEMBER_ID, example = E_MEMBER_ID, required = true)
    @NotNull(message = M_MEMBER_ID_NOT_NULL)
    @Length(max = 32, message = M_MEMBER_ID_MAX)
    private String memberId;

    @ApiModelProperty(notes = N_SOURCE, example = E_SOURCE)
    @Length(max = 50, message = M_SOURCE_MAX)
    private String source;

    @ApiModelProperty(notes = N_PERSON_AREA, example = E_PERSON_AREA, allowableValues = PersonAreaType.VALUES_STR)
    @Length(max = 50, message = M_PERSON_AREA_MAX)
    @Const(constClass = PersonAreaType.class, message = M_PERSON_AREA_ENUM_NOT_MATCH)
    private String personArea;

    @ApiModelProperty(notes = N_ID_NO, example = E_ID_NO)
    @Length(max = 50, message = M_ID_NO_MAX)
    private String idNo;

    @ApiModelProperty(notes = N_NAME, example = E_NAME)
    @Length(max = 255, message = M_NAME_MAX)
    private String name;

    @ApiModelProperty(notes = N_MOBILE, example = E_MOBILE)
    @Length(max = 45, message = M_MOBILE_MAX)
    private String mobile;

    @ApiModelProperty(notes = N_EMAIL, example = E_EMAIL)
    @Length(max = 255, message = M_EMAIL_MAX)
    private String email;

    @ApiModelProperty(notes = N_ORGAN, example = E_ORGAN)
    @Length(max = 255, message = M_ORGAN_MAX)
    private String organ;

    @ApiModelProperty(notes = N_TITLE, example = E_TITLE)
    @Length(max = 100, message = M_TITLE_MAX)
    private String title;

    @ApiModelProperty(notes = N_ADDRESS, example = E_ADDRESS)
    @Length(max = 255, message = M_ADDRESS_MAX)
    private String address;

    @ApiModelProperty(notes = N_COUNTRY, example = E_COUNTRY)
    @Length(max = 50, message = M_COUNTRY_MAX)
    private String country;

    @ApiModelProperty(notes = N_PROVINCE, example = E_PROVINCE)
    @Length(max = 50, message = M_PROVINCE_MAX)
    private String province;

    @ApiModelProperty(notes = N_DEPARTMENT, example = E_DEPARTMENT)
    @Length(max = 30, message = M_DEPARTMENT_MAX)
    private String department;

    @ApiModelProperty(notes = N_ORGAN_TYPE, example = E_ORGAN_TYPE, allowableValues = OrganType.VALUES_STR)
    @Const(constClass = OrganType.class, message = M_ORGAN_TYPE_ENUM_NOT_MATCH)
    private Integer organType;

    @ApiModelProperty(notes = N_USER_TYPE, example = E_USER_TYPE, allowableValues = EnterpriseUserType.VALUES_STR)
    @Const(constClass = EnterpriseUserType.class, message = M_USER_TYPE_ENUM_NOT_MATCH)
    private Integer userType;

    @ApiModelProperty(notes = N_ORGAN_CODE, example = E_ORGAN_CODE)
    @Length(max = 30, message = M_ORGAN_CODE_MAX)
    private String organCode;

    @ApiModelProperty(notes = N_LEGAL_NAME, example = E_LEGAL_NAME)
    @Length(max = 20, message = M_LEGAL_NAME_MAX)
    private String legalName;

    @ApiModelProperty(notes = N_LEGAL_AREA, example = E_LEGAL_AREA, allowableValues = LegalAreaType.VALUES_STR)
    @Const(constClass = LegalAreaType.class, message = M_LEGAL_AREA_ENUM_NOT_MATCH)
    private Integer legalArea;

    @ApiModelProperty(notes = N_AGENT_NAME, example = E_AGENT_NAME)
    @Length(max = 20, message = M_AGENT_NAME_MAX)
    private String agentName;

    @ApiModelProperty(notes = N_AGENT_ID_NO, example = E_AGENT_ID_NO)
    @Length(max = 50, message = M_AGENT_ID_NO_MAX)
    private String agentIdNo;

    @ApiModelProperty(notes = N_SCOPE, example = E_SCOPE)
    @Length(max = 255, message = M_SCOPE_MAX)
    private String scope;

    @ApiModelProperty(notes = N_REG_TYPE, example = E_REG_TYPE, allowableValues = EnterpriseRegType.VALUES_STR)
    @Length(max = 20, message = M_REG_TYPE_MAX)
    @Const(constClass = EnterpriseRegType.class, message = M_REG_TYPE_ENUM_NOT_MATCH)
    private String regType;


}

